home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / sendmail.8.8.4.tar.gz / sendmail.8.8.4.tar / sendmail-8.8.4 / contrib / converting.sun.configs < prev    next >
Text File  |  1993-08-25  |  16KB  |  447 lines

  1.  
  2.              Converting Standard Sun Config
  3.               Files to Sendmail Version 8
  4.  
  5.                   Rick McCarty
  6.              Texas Instruments Inc.
  7.              Latest Update: 08/25/93 - RJMc
  8.  
  9. This document details the changes necessary to continue using your
  10. current SunOS sendmail.cf with sendmail version 8.  In the longer term,
  11. it is recommended that one move to using an m4 based configuration such
  12. as those shipped with sendmail, but if you're like me and have made
  13. enough modifications to your .cf file that you'd rather put that task
  14. off until later, here's the sum total of my experience to get you to
  15. version 8 with minimal pain.  I'll cover .cf as well as build issues.
  16.  
  17. Some background - as many are surely aware, Sun has some "special"
  18. features in the sendmail they ship ($%x, %y LHS lookup, NIS alias DB
  19. search, etc.).  (Some of those features can be had in alternative forms
  20. in IDA sendmail, but v8 has picked up some IDA capabilities as well as
  21. new ones, making it IMHO a most desirable version to go to.)  What I
  22. will explain below includes v8 functional "equivalences" to these Sun
  23. sendmail features.
  24.  
  25. So with that out of the way, let's begin.
  26.  
  27. First, some assumptions:
  28.  
  29.     1) I'm going to assume you've got sendmail version 8.6 or
  30.        later in hand - if not, grab it from ftp.cs.berkeley.edu
  31.        in the ucb/sendmail directory.  There are bugs in earlier
  32.        versions which affect some of the needed functionality.
  33.  
  34.     2) Second, I'm going to detail this based upon the
  35.        "sendmail.main.cf" configuration.  (BTW, if you attempt
  36.        to move to using an m4 generated config in the future,
  37.        MAIL_HUB is the feature which should provide similar
  38.        functionality).
  39.  
  40.        In general, the changes will be similar for a subsidiary
  41.        file, but since we (my TI group) funnel all non-local mail
  42.        through our mailhost, we're not as interested in getting v8
  43.        to run on such systems and I haven't tried it.
  44.  
  45.     3) You're using DNS and sendmail.mx.  If you're not, you ought
  46.        to be, even if you're also running it along with NIS (which
  47.        we do - except for gethostbyxxx() lookups, which I'll be
  48.        talking about later).  I would imagine you could get things
  49.        running OK without DNS support, but I haven't tried it myself.
  50.  
  51.     4) You're not mounting /var/spool/mail from other systems.
  52.        I haven't found a v8 feature to guarantee this will work
  53.        correctly.  Anyway, in the past, we've tried doing that
  54.        here and found it to be a rather "ugly" feature, though
  55.        Sun ostensibly supports it ("R" option).  Perhaps v8
  56.        will one day have a similar feature, but for now, bottom
  57.        line, I would recommend against it.
  58.  
  59.     5) You're not on Solaris or using NIS+.  I'm on 4.1.3.  I've
  60.        looked at Solaris briefly and have noted that things are
  61.        pretty much similar there except that they've moved some
  62.        things into the /etc/mail directory.  I'd guess the
  63.        executables aren't functionally all that different from
  64.        what they had before - the configs are roughly the same.
  65.        So I'd bet most of what I say in here will apply to
  66.        Solaris.
  67.  
  68. OK, let's configure our sendmail.cf!  I'll just go from the top down...
  69.  
  70.               VARIOUS DECLARATIONS
  71.  
  72. 1) For v8, you need to define your .cf as AT LEAST a version level 4
  73.    configuration.  Add the following line:
  74.  
  75.     V4
  76.  
  77.    There are some issues regarding certain predefined macros - $w, $j, and
  78.    $m.  With a V4 configuration:
  79.  
  80.     $w is defined to be the hostname, which will usually be fully
  81.     qualified (i.e. "firefly.add.itg.ti.com").
  82.  
  83.     $j should have the same value as $w.
  84.  
  85.     $m will be predefined as the domain portion of $w
  86.     (ex. "add.itg.ti.com").
  87.  
  88.    One note about this - if your configuration relies on the "w" macro to
  89.    be the "simple" hostname (as mine does)...
  90.  
  91.    If the configuration version is 5 or larger:
  92.  
  93.     $w is supposed to be the "simple" name (ex. "firefly")
  94.  
  95.     $j should be the fully qualified name (i.e. "firefly.add.itg.ti.com")
  96.  
  97.     $m will be predefined as the domain portion of $j
  98.     (ex. "add.itg.ti.com").
  99.  
  100.    I have not experimented with the various combinations, so I cannot
  101.    guarantee you that the above definitions will always come out as
  102.    expected.  Bottom line:  if your sendmail.cf depends on $w being the
  103.    simple hostname, test it carefully or define the name explicitly,
  104.    for example:
  105.  
  106.     Dwfirefly
  107.  
  108. 2) To replace the Sun's "%y" feature, we must use a hostname mapping
  109.    feature in v8.  If you want to do similar lookups with v8, you need
  110.    to define the following map (we'll go over the rules that use this
  111.    map later):
  112.  
  113.     Khostlookup host -f -m -a.
  114.  
  115.    This will define a "lookup only" map that is otherwise the same as
  116.    sendmail version 8's built-in "host" map (see the "Sendmail
  117.    Installation and Operation Guide" for details on this map.).
  118.  
  119.    An important note:  Whether or not these lookups will be done via
  120.    NIS is a function of what gethostbyxxx() functions you link into
  121.    your sendmail.  DO NOT redefine your host mapping to use NIS
  122.    explicitly within sendmail - there can be unexpected behaviour if
  123.    you do so (if you do any canonicalization in your .cf, you can get
  124.    incorrect results, for one thing).
  125.  
  126.    For example, DO NOT TRY:
  127.  
  128.     Khost nis -f -a. hosts.byname
  129.  
  130. 3) If you're doing reverse alias mapping as done in ruleset 22, instead of:
  131.  
  132.     DZmail.byaddr
  133.  
  134.    you'll need to declare the following:
  135.  
  136.     Kaliasrev nis -f -N mail.byaddr
  137.  
  138. 4) If you are doing any other NIS map lookups, you'll need to define the
  139.    map as done in the below example.  I have a "mailhosts" map, which I
  140.    use to distinguish between local and non-local hosts.  Look at the
  141.    sendmail doc for details on this stuff.
  142.  
  143.     Kmailhosts nis -f -m -a. mailhosts 
  144.  
  145. 5) You might wish to add the following line to support Errors-To: headers.
  146.    I don't.
  147.  
  148.     Ol
  149.  
  150. 6) Comment out/remove the following line:
  151.  
  152.     OR
  153.  
  154.    The R option means something different under v8 - check the documentation
  155.    if you're interested in using it.
  156.  
  157. 7) If you're running NIS and have a separate alias map, BELOW the
  158.    following line where the alias file is declared:
  159.  
  160.     OA/etc/aliases
  161.  
  162.    ADD the following:
  163.  
  164.     OAnis:mail.aliases
  165.  
  166.    This will set things up so v8 will look at the local alias DB first,
  167.    then the NIS map, just as Sun sendmail does.
  168.  
  169. 8) Though you don't have to, I'd suggest changing:
  170.  
  171.     OT3d
  172.  
  173.    to use v8's warning feature, which allows a warning message to be
  174.    sent if a message cannot be delivered within a specified period.
  175.    I use:
  176.  
  177.     OT5d/4h
  178.  
  179.    which says - bounce after 5 days, warn after 4 hours.
  180.  
  181. 9) I set the following option to be explicit about how I want DNS
  182.     handled:
  183.  
  184.     OI +DNSRCH +DEFNAMES
  185.  
  186. 10) The following line:
  187.  
  188.     T root daemon uucp
  189.  
  190.     may be deleted, though it will be ignored if you leave it around.
  191.  
  192. 11) It would probably be good to change the version macro value (which
  193.     shows up in "Received:" headers) so no one debugging mail problems
  194.     gets the wrong idea about what config you're running under.  Look
  195.     for something like:
  196.  
  197.     DVSMI-4.1
  198.  
  199.     Mine, for example is:
  200.  
  201.     DVADD-HUB-2.1
  202.  
  203.                 RULESETS
  204.  
  205. 1)  In ruleset 3, BELOW this rule:
  206.  
  207.     # basic textual canonicalization
  208.     R$*<$+>$*        $2            basic RFC822 parsing
  209.  
  210.  
  211. I add the following rule to remove a trailing dot in the domain spec so
  212. it won't interfere with v8 mapping features, etc.  (Having a trailing dot is
  213. not RFC-compliant anyway.):
  214.  
  215.     R$+.            $1
  216.  
  217. 2) Because ruleset 5 is special in v8, I rename it to S95 and also change
  218.    all RHS expressions containing ">5" to use ">95" instead.  In v8,
  219.    5 is executed against addresses which resolve to the local mailer and
  220.    are not an alias.  If you don't change S5 to something else, you might
  221.    get a surprise!
  222.  
  223. 3) If you're doing any lookups via the generalized NIS "$%x/$!x"
  224.    mechanisms (such as with the mailhost map I referred to earlier) it's
  225.    done differently under v8.  For example:
  226.  
  227.     DMmailhosts
  228.     ...
  229.     R$*<@$%M.uucp>$*    $#ether $@$2 $:$1<@$2>$3
  230.  
  231.    takes a different map definition and two rules under version 8:
  232.  
  233.     Kmailhosts nis -f -m -a. mailhosts
  234.     ...
  235.     R$*<@$+.uucp>$*        $: $1<@$(mailhosts $2 $).uucp>$3
  236.     R$*<@$+..uucp>$*    $#ether $@$2 $:$1<@$2>$3
  237.  
  238. 4) Sun has a special case of the "$%x" feature for host lookups - "%y" is
  239.    automagically defined to do an NIS "hosts.byname" search with no other
  240.    definition, as done in the below example:
  241.  
  242.     R$*<@$%y.LOCAL>$*    $#ether $@$2 $:$1<@$2>$3
  243.  
  244.    (Sun does this in more than one place.  But the above syntax is almost
  245.     identical in each - mostly a case of changing names to protect the
  246.     innocent.)
  247.  
  248.    In version 8, the predefined "host" map can be used to do essentially
  249.    the same thing.  (However, whether or not it does an NIS lookup is
  250.    a function of what gethostbyxxx() functions are linked in.)
  251.  
  252.    Recall the map definition I mentioned earlier in the DECLARATIONS
  253.    section:
  254.  
  255.     Khostlookup host -f -m -a.
  256.  
  257.    Here's where we will use it.  It will take two rules:
  258.  
  259.     R$*<@$+.LOCAL>$*    $: $1<@$(hostlookup $2 $).LOCAL>$3
  260.     R$*<@$+..LOCAL>$*    $#ether $@$2 $:$1<@$2>$3
  261.  
  262.    Note that this is almost verbatim the same change as was used in the
  263.    previous "mailhosts" example.
  264.  
  265. 5) Although Sun's default configs don't do this, because I mentioned
  266.    canonicalization earlier, it deserves an example, as it's illustrative
  267.    of the functional difference in the map definitions I discussed before.
  268.    This stuff is also convered in the "Sendmail Installation and Operation
  269.    Guide".
  270.  
  271.    Remember the built-in "host" map definition?  As you'll recall, unlike
  272.    the "hostlookup" map we defined, "host" will actually CHANGE the
  273.    hostname in addition to appending a dot.  "hostlookup" only appends a
  274.    dot if the name is found and doesn't change it otherwise.  Anyway,
  275.    here's the example:
  276.  
  277.     R$*<@$+>$*    $: $1<@$(host $2 $)>$3        canonicalize
  278.     R$*<@$+.>$*    $1<@$2>$3            remove trailing dot
  279.  
  280.    Using the above, say you had input of:
  281.  
  282.     joe<@tilde>
  283.  
  284.     OR
  285.  
  286.     joe<@[128.247.160.56]>
  287.  
  288.     Assuming "tilde" or the IP address is found, it might be
  289.         canonicalized as:
  290.  
  291.     joe<@tilde.csc.ti.com>
  292.  
  293. 6) As another instance of the NIS lookup feature, with a slightly
  294.    different twist, Sun implements reverse alias mapping in ruleset 22
  295.    with the below:
  296.  
  297.     DZmail.byaddr
  298.     ...
  299.     R$-<@$->        $:$>3${Z$1@$2$}            invert aliases
  300.  
  301.    To use this feature under v8, change the above rule a (remember to
  302.    define the alias map as I showed earlier):
  303.  
  304.     R$-<@$->        $:$>3$(aliasrev $1@$2 $)    invert aliases
  305.  
  306.  
  307.                MAILER DEFINITIONS
  308.  
  309. 1) Where "TCP" is defined in the "P=" and "A=" parameters of mailers, I
  310.    changed it to "IPC".  Version 8 will accept "TCP", but "IPC" is
  311.    preferred.
  312.  
  313. 2) On all IPC mailers, I also defined "E=\r\n" and added an "L=1000" as
  314.    in the below example:
  315.  
  316.     Mether,    P=[IPC], F=mDFMuCX, S=11, R=21, L=1000, E=\r\n, A=IPC $h
  317.  
  318.    The "E=\r\n" will save you headaches interoperating with such things as
  319.    VMS TCP products.
  320.  
  321.    The "L=1000" is for RFC821 compatibility.  Not strictly necessary.
  322.  
  323.    I also removed the "s" (strip quotes) mailer flag Sun puts in for
  324.    these mailers.  Stripping quotes violates protocols, which say
  325.    clearly that you can't touch the local-part (left hand side of
  326.    the @) until you are on the delivering host.
  327.  
  328. NOW.  If I haven't left anything out, you should be able to run through
  329. your Sun sendmail.cf file and convert it to run under v8.
  330.  
  331.                   BUILD ISSUES
  332.  
  333. Some important notes on building v8 on SunOS:
  334.  
  335. Makefile
  336.  
  337. The default makefile in the version 8 source (src) directory assumes the
  338. new Berkeley make.  Unless you want to go to the trouble of building it,
  339. you can use your regular make, but you need to use a different makefile.
  340. You can use "Makefile.dist" or "Makefile.SunOS" in the src directory.  I
  341. made changes to get it to build so it is as compatible as possible with
  342. the file/directory locations Sun uses.  Here are some relevant sections
  343. out of my makefile:
  344.  
  345.     CC=gcc
  346.  
  347.     # use O=-O (usual) or O=-g (debugging)
  348.     O=    -O
  349.  
  350.     # define the database mechanisms available for map & alias lookups:
  351.     #    -DNDBM -- use new DBM
  352.     #    -DNEWDB -- use new Berkeley DB
  353.     #    -DNDBM -DNEWDB -DYPCOMPAT -- use both plus YP compatility
  354.     #    -DNIS -- include client NIS support
  355.     # The really old (V7) DBM library is no longer supported.
  356.     # See READ_ME for a description of how these flags interact.
  357.     #DBMDEF= -DNDBM -DNEWDB
  358.     DBMDEF=    -DNDBM -DNIS
  359.  
  360.     # environment definitions (e.g., -D_AIX3)
  361.     ENVDEF=
  362.  
  363.     # see also conf.h for additional compilation flags
  364.  
  365.     # library directories
  366.     LIBDIRS=-L/usr/local/lib
  367.  
  368.     # libraries required on your system
  369.     #LIBS=    -ldb -ldbm
  370.     LIBS=    -ldbm -lresolv
  371.  
  372.     # location of sendmail binary (usually /usr/sbin or /usr/lib)
  373.     BINDIR=    ${DESTDIR}/usr/lib
  374.  
  375.     # location of sendmail.st file (usually /var/log or /usr/lib)
  376.     STDIR=    ${DESTDIR}/etc
  377.  
  378.     # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  379.     HFDIR=    ${DESTDIR}/usr/lib
  380.  
  381. For the resolver library, you can use the one shipped with Sun if you
  382. want.  But I'd recommend using another version of the resolver library
  383. (such as the one with Bind 4.8.3 or 4.9).  Sun's resolver stuff (at
  384. least with 4.1.x) is quite old - I believe it is of 4.3.1 vintage.  (Do
  385. you get the impression I don't TRUST what Sun ships with their systems?)
  386.  
  387. If you want NIS host lookup while maintaining DNS capability, you might
  388. take a look at resolv+, which has NIS capable gethostbyxxx() functions
  389. in it.  My recommendation, however, is to avoid doing NIS host lookups
  390. in sendmail altogether, and to use a "pure" version of the resolver
  391. library.
  392.  
  393. There are probably no situations (at least I think so) where it makes
  394. any sense to link in Sun's NIS gethostbyxxx() functions from libc.
  395. You could, I guess do it (I haven't tried it) and wind up with a
  396. sendmail equivalent to the non-mx version Sun ships.  You'd need to
  397. insure that NAMED_BIND is not defined in the build.  (If you do
  398. this and have the "-b" DNS passthru option set in NIS, remember that
  399. while you have some DNS functionality you'll not have any MX support.
  400. (This, IMO, is what makes this a non-optimal choice.)
  401.  
  402.               INSTALLATION/TESTING ISSUES
  403.  
  404. The sendmail.hf file in the src directory should replace the one currently
  405. in /usr/lib.  You also might choose to edit it a bit to "localize" what it
  406. says.
  407.  
  408. The sendmail executable goes, of course, in /usr/lib in place of the current
  409. one.  What I did was create a subdirectory in /usr/lib and put all of the
  410. Sun sendmail stuff in there.  I named the v8 sendmail executable to be
  411. sendmail.v8.mx and then symbolically linked it to sendmail.
  412.  
  413. One other thing.  If you use address test mode, keep in mind that
  414. Version 8 is like IDA in that it does not automatically execute ruleset
  415. 3 first.  So say you're playing around with things testing addresses and
  416. you're used to things like:
  417.  
  418.     0 jimbob@good.old.boy.com
  419.  
  420. under v8 you need to say instead:
  421.  
  422.     3,0 jimbob@good.old.boy.com
  423.  
  424.           INTEROPERABILITY ISSUES YOU MIGHT ENCOUNTER
  425.  
  426. Be aware that sendmail v8 issues a multi-line SMTP welcome (220)
  427. response upon a client connection.  Most systems in your network should
  428. handle it OK, but there are some that choke on it, because whoever wrote
  429. the clients assumed only a single line.  THIS IS NOT SENDMAIL's FAULT.
  430. A multi-line 220 response is perfectly valid.  A likely place you'll
  431. encounter this problem is with non-Un*x SMTP clients.  If you do run
  432. into it, you should report it to the vendor.
  433.  
  434. A final note about version 8 - if you follow the above configuration
  435. scenario, you'll notice it doesn't like to get envelope sender
  436. addresses it doesn't know how to get back to.  Sun sendmail would take
  437. anything, even though it might not be able to bounce the message back
  438. should something happen downstream.  So if another sendmail on a host
  439. that's not locally known is trying to pump mail through your v8 host,
  440. the ENVELOPE sender it gives had better be fully qualified.  This is
  441. a GREAT thing, because it helps clear up problems we've had with not
  442. being able to get things back to the sender, resulting in an
  443. overburdened postmaster.
  444.  
  445. I hope this helps those running Sun sendmail feel more at ease with moving
  446. on to v8.  It's really worth going to.
  447.